import request from '@/utils/request'

// 认证相关 API
export const authAPI = {
  // 发送短信验证码
  sendSmsCode(phone) {
    return request.post('/auth/send-sms', { phone })
  },

  // 手机验证码登录
  loginBySms(phone, code) {
    return request.post('/auth/login-sms', { phone, code })
  },

  // 密码登录
  loginByPassword(phone, password) {
    return request.post('/auth/login-password', { phone, password })
  },

  // Token 登录
  loginByToken(token) {
    return request.post('/auth/login-token', { token })
  },

  // 忘记密码
  forgetPassword(phone, code, newPassword) {
    return request.post('/auth/forget-password', { phone, code, newPassword })
  },

  // 退出登录
  logout() {
    return request.post('/auth/logout')
  }
}


